winsafe\taskschd\com_interfaces/idailytrigger.rs
1#![allow(non_camel_case_types, non_snake_case)]
2
3use crate::decl::*;
4use crate::macros::*;
5use crate::ole::privs::*;
6use crate::prelude::*;
7use crate::taskschd::vts::*;
8
9com_interface! { IDailyTrigger: "126c5cd8-b288-41d5-8dbf-e491446adc5c";
10 /// [`IDailyTrigger`](https://learn.microsoft.com/en-us/windows/win32/api/taskschd/nn-taskschd-idailytrigger)
11 /// COM interface.
12 ///
13 /// Automatically calls
14 /// [`Release`](https://learn.microsoft.com/en-us/windows/win32/api/unknwn/nf-unknwn-iunknown-release)
15 /// when the object goes out of scope.
16 ///
17 /// # Examples
18 ///
19 /// ```no_run
20 /// use winsafe::{self as w, prelude::*};
21 ///
22 /// let trigger: w::ITrigger; // initialized somewhere
23 /// # let trigger = unsafe { w::ITrigger::null() };
24 ///
25 /// let daily_trigger = trigger
26 /// .QueryInterface::<w::IDailyTrigger>()?;
27 /// # w::HrResult::Ok(())
28 /// ```
29}
30
31impl oleaut_IDispatch for IDailyTrigger {}
32impl taskschd_ITrigger for IDailyTrigger {}
33impl taskschd_IDailyTrigger for IDailyTrigger {}
34
35/// This trait is enabled with the `taskschd` feature, and provides methods for
36/// [`IDailyTrigger`](crate::IDailyTrigger).
37///
38/// Prefer importing this trait through the prelude:
39///
40/// ```no_run
41/// use winsafe::prelude::*;
42/// ```
43pub trait taskschd_IDailyTrigger: taskschd_ITrigger {
44 /// [`IDailyTrigger::get_DaysInterval`](https://learn.microsoft.com/en-us/windows/win32/api/taskschd/nf-taskschd-idailytrigger-get_daysinterval)
45 /// method.
46 #[must_use]
47 fn get_DaysInterval(&self) -> HrResult<i16> {
48 let mut days = i16::default();
49 HrRet(unsafe { (vt::<IDailyTriggerVT>(self).get_DaysInterval)(self.ptr(), &mut days) })
50 .to_hrresult()
51 .map(|_| days)
52 }
53
54 fn_com_bstr_get! { get_RandomDelay: IDailyTriggerVT;
55 /// [`IDailyTrigger::get_RandomDelay`](https://learn.microsoft.com/en-us/windows/win32/api/taskschd/nf-taskschd-idailytrigger-get_randomdelay)
56 /// method.
57 }
58
59 /// [`IDailyTrigger::put_DaysInterval`](https://learn.microsoft.com/en-us/windows/win32/api/taskschd/nf-taskschd-idailytrigger-put_daysinterval)
60 /// method.
61 fn put_DaysInterval(&self, days: i16) -> HrResult<()> {
62 HrRet(unsafe { (vt::<IDailyTriggerVT>(self).put_DaysInterval)(self.ptr(), days) })
63 .to_hrresult()
64 }
65
66 fn_com_bstr_set! { put_RandomDelay: IDailyTriggerVT, random_delay;
67 /// [`IDailyTrigger::put_RandomDelay`](https://learn.microsoft.com/en-us/windows/win32/api/taskschd/nf-taskschd-idailytrigger-put_randomdelay)
68 /// method.
69 }
70}